<template>
  <section>
    <banner></banner>

    <div class="div_1200">
      <div class="div_con">
        <h1>{{art.tit}}</h1>
        <div class="newContent" v-html="art.con"></div>
        {{art.content}}
      </div>
    </div>
  </section>
</template>
<script>
import banner from "../../components/banner.vue";
export default {
  data() {
    return {};
  },
  methods: {},
  mounted() {},
  props: {},
  components: {
    banner
  },
  watchQuery: ["artId"],
  async asyncData({
    isDev,
    route,
    store,
    env,
    params,
    query,
    req,
    res,
    redirect,
    error
  }) {
    return await new Promise((resolve, reject) => {
      store.commit("ajax", {
        class: "art",
        para: "getArt",
        j: {
          _id: query.artId
        },
        fun: res => {
          if (!res.data.err) {
            resolve({
              art: res.data.info
            });
          } else {
            console.log(res.data.err);
          }
        }
      });
    });
  }
};
</script>
<style scoped>
.div_con {
  padding: 10px;
  min-height: 600px;
}
h1 {
  padding: 10px 0px;
}
.newContent {
  line-height: 25px;
  padding: 1%;
  width: 98%;
  text-align: left;
}
</style>
